<template>
  <div>
    <button
      @click="router.push({ name: 'Item', params: { id: 1, name: '黎少原' } })"
    >
      黎少原
    </button>
    <button
      @click="router.push({ name: 'Item', params: { id: 2, name: '郭佳慧' } })"
    >
      郭佳慧
    </button>
    <button
      @click="router.push({ name: 'Item', params: { id: 3, name: '妞妞原' } })"
    >
      妞妞原
    </button>
    <router-view v-slot="{ Component }">
      <keep-alive>
        <component :is="Component" />
      </keep-alive>
    </router-view>
  </div>
</template>

<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  name: "Pay",
});
</script>

<script setup lang="ts">
import { useRouter } from "vue-router";
const router = useRouter();
</script>

<style scoped></style>
